package com.faith.dynamic.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * @ClassName FaithThreadPoolConfig$
 * @Description 线程配置
 * @Author faith$
 * @Date 2019/8/13 14:43
 * @Version 1.0
 **/
@Configuration
public class FaithThreadPoolConfig {
    @Bean("faithThreadScheduler")
    public ThreadPoolTaskScheduler trPoolTaskScheduler(){
        ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
        //核心线程数
        threadPoolTaskScheduler.setPoolSize(5);
        return threadPoolTaskScheduler;
    }
}
